<template>
  <div id="app">
    <div id="nav">
      <router-link to="/">Home</router-link> |
      <router-link :to="{name:'first'}">first</router-link> |
      <router-link to="/bmi">bmi</router-link>|
      <router-link to="/second">
      <button>回到first</button>
      </router-link> |
      <router-link to="/age">age</router-link>
    </div>
    <div @click="handle('home')">home</div>
    <div @click="handle('first')">first</div>
    <div @click="handle('bmi')">bmi</div>
    <router-view />
  </div>
</template>

<script>
export default {
  methods: {
    handle(name){
      this.$router.push({
        name
      })
    }
  },
}
</script>

<style lang="stylus">
#app
  font-family Avenir, Helvetica, Arial, sans-serif
  -webkit-font-smoothing antialiased
  -moz-osx-font-smoothing grayscale
  text-align center
  color #2c3e50
  margin-top 60px
</style>
